import request from '@/utils/request';
import {
  ScenicQuery,
  ScenicVO,
  ScenicForm,
  BrandForm,
  BrandQuery,
  BrandVO,
  ActivitiesForm,
  ActivitiesQuery,
  ActivitiesVO,
  VillageForm,
  VillageQuery,
  VillageVO,
  FarmerForm,
  FarmerQuery,
  FarmerVO,
  AirviewForm,
  AirviewQuery,
  AirviewVO,
  WarmVillageForm,
  WarmVillageQuery,
  WarmVillageVO
} from './types';
import { AxiosPromise } from 'axios';
// 查询景点列表
export function listScenic(query: ScenicQuery): AxiosPromise<ScenicVO[]> {
  return request({
    url: '/base/check_in_spot/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getScenicDetail(id: string | number): AxiosPromise<ScenicVO> {
  return request({
    url: '/base/check_in_spot/detail?id=' + id,
    method: 'get'
  });
}

// 新增景点
export function addScenic(data: ScenicForm) {
  return request({
    url: '/base/check_in_spot/add',
    method: 'post',
    data: data
  });
}

// 修改景点
export function updateScenic(data: ScenicForm) {
  return request({
    url: '/base/check_in_spot/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleScenicStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/check_in_spot/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}

// 查询品牌列表
export function listBrand(query: BrandQuery): AxiosPromise<BrandVO[]> {
  return request({
    url: '/base/brand/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getBrandDetail(id: string | number): AxiosPromise<BrandVO> {
  return request({
    url: '/base/brand/detail?id=' + id,
    method: 'get'
  });
}

// 新增品牌
export function addBrand(data: BrandForm) {
  return request({
    url: '/base/brand/add',
    method: 'post',
    data: data
  });
}

// 修改活动项目
export function updateBrand(data: BrandForm) {
  return request({
    url: '/base/brand/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleBrandStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/brand/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}

// 查询活动项目列表
export function listActivities(query: ActivitiesQuery): AxiosPromise<ActivitiesVO[]> {
  return request({
    url: '/base/activity/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getActivitiesDetail(id: string | number): AxiosPromise<ActivitiesVO> {
  return request({
    url: '/base/activity/detail?id=' + id,
    method: 'get'
  });
}

// 新增
export function addActivities(data: ActivitiesForm) {
  return request({
    url: '/base/activity/add',
    method: 'post',
    data: data
  });
}

// 修改活动项目
export function updateActivities(data: ActivitiesForm) {
  return request({
    url: '/base/activity/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleActivitiesStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/activity/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}

// 查询乡村振兴列表
export function listVillage(query: VillageQuery): AxiosPromise<VillageVO[]> {
  return request({
    url: '/base/rural_revitalization/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getVillageDetail(id: string | number): AxiosPromise<VillageVO> {
  return request({
    url: '/base/rural_revitalization/detail?id=' + id,
    method: 'get'
  });
}

// 新增
export function addVillage(data: VillageForm) {
  return request({
    url: '/base/rural_revitalization/add',
    method: 'post',
    data: data
  });
}

// 修改活动项目
export function updateVillage(data: VillageForm) {
  return request({
    url: '/base/rural_revitalization/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleVillageStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/rural_revitalization/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}
// 查询新农人列表
export function listFarmer(query: FarmerQuery): AxiosPromise<FarmerVO[]> {
  return request({
    url: '/base/farmer_join/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getFarmerDetail(id: string | number): AxiosPromise<FarmerVO> {
  return request({
    url: '/base/farmer_join/detail?id=' + id,
    method: 'get'
  });
}

// 新增
export function addFarmer(data: FarmerForm) {
  return request({
    url: '/base/farmer_join/add',
    method: 'post',
    data: data
  });
}

// 修改活动项目
export function updateFarmer(data: FarmerForm) {
  return request({
    url: '/base/farmer_join/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleFarmerStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/farmer_join/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}
// 查询航拍实景图列表
export function listAirview(query: AirviewQuery): AxiosPromise<AirviewVO[]> {
  return request({
    url: '/base/airview/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getAirviewDetail(id: string | number): AxiosPromise<AirviewVO> {
  return request({
    url: '/base/airview/detail?id=' + id,
    method: 'get'
  });
}

// 新增
export function addAirview(data: AirviewForm) {
  return request({
    url: '/base/airview/add',
    method: 'post',
    data: data
  });
}

// 修改活动项目
export function updateAirview(data: AirviewForm) {
  return request({
    url: '/base/airview/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleAirviewStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/airview/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}
// 查询林渡暖村列表
export function listWarmVillage(query: WarmVillageQuery): AxiosPromise<WarmVillageVO[]> {
  return request({
    url: '/base/warm_village/list',
    method: 'post',
    data: query
  });
}

// 查询详情
export function getWarmVillageDetail(id: string | number): AxiosPromise<WarmVillageVO> {
  return request({
    url: '/base/warm_village/detail?id=' + id,
    method: 'get'
  });
}

// 新增
export function addWarmVillage(data: WarmVillageForm) {
  return request({
    url: '/base/warm_village/add',
    method: 'post',
    data: data
  });
}

// 修改
export function updateWarmVillage(data: WarmVillageForm) {
  return request({
    url: '/base/warm_village/update',
    method: 'post',
    data: data
  });
}

//修改状态
export function handleWarmVillageStatus(id: Array<String>, status: boolean) {
  return request({
    url: '/base/warm_village/enable ',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  });
}
